package com.uzai.console.web.app;

import com.uzai.console.dto.app.personalCenter.AppPersonalCenterConfigDto;
import com.uzai.console.service.app.AppPersonalCenterService;
import com.uzai.console.vo.app.personalcenter.AppPersonalCenterConfigVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "app个人中心",tags = "app个人中心")
@RestController
@RequestMapping(value = "/appPersonal")
public class AppPersonalCenterController extends BaseController {

    @Autowired
    private AppPersonalCenterService appPersonalCenterService;

    @ApiOperation(value = "查询app个人中心配置信息", notes = "查询app个人中心配置信息", response = AppPersonalCenterConfigVo.class)
    @PostMapping("/queryAppPersonCenter")
    public Object queryAppPersonCenter(){
        return appPersonalCenterService.queryAppPersonCenter(getLoginInfo().getMerId());
    }

    @ApiOperation(value = "复制app个人中心配置信息", notes = "复制app个人中心配置信息", response = AppPersonalCenterConfigVo.class)
    @PostMapping("/copyCmsPersonCenter")
    public Object copyCmsPersonCenter(){
        return appPersonalCenterService.copyCmsPersonCenter(getLoginInfo().getMerId());
    }


    @ApiOperation(value = "修改app个人中心配置信息", notes = "修改app个人中心配置信息", response = boolean.class)
    @PostMapping("/updateAppPersonCenter")
    public Object updateAppPersonCenter(@RequestBody AppPersonalCenterConfigDto appPersonalCenterDto){
        appPersonalCenterService.updateAppPersonCenter(appPersonalCenterDto);
        return true;
    }
}
